
<!DOCTYPE html>
<html>
<head>
<title>作 业</title>
<meta charset="utf-8" >
<meta name="renderer" content="webkit">
<meta name="author" content="XYB" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="format-detection" content="telphone=no, email=no"/>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../../static/css/bootstrap.min.css">
<link rel="stylesheet" href="../../static/css/paging.min.css">
<link rel="stylesheet" href="../../static/css/init.css">
<link rel="stylesheet" href="../../static/css/common.css">
<link rel="stylesheet" href="../../static/css/faq/faq.css">
<link rel="icon" href="../../static/images/favicon.ico" type="image/x-icon">
<style>
.task-area{
	padding:10px 10px 120px 10px;
}
.task-tables{
	width:96%;
	margin-left:auto;
	margin-right:auto;
	border:1px solid #333;
}
.task-tables thead tr{
	background: #d9edf7;
}
.task-tables tr{
	border-top:1px solid #333;
}
.task-tables tr td{
	text-align: center;
	height:45px;
	line-height:45px;
	font-size:14px;

}
.task-tables tr td:nth-child(1),
.task-tables tr td:nth-child(3)，
.task-tables tr td:nth-child(5){
	width:15%;
}
.task-tables tr td:nth-child(2){
	width:25%;
	border-left:1px solid #333;
	border-right:1px solid #333;
}
.task-tables tr td:nth-child(4){
	width:30%;
	border-left:1px solid #333;
	border-right:1px solid #333;
}
.task-tables tr td:nth-child(5){
	border-right:1px solid #333;
}
.task-tables tbody tr:nth-child(even){
	background:#d7d7d7;
}


</style>
</head>
<body>
    <header id="header" class="relative full-x"></header>

    <div class="allwarp relative">

        <div class="main-Content">
            <div class="common-cont task-area mt-20 full-x bg-fff rad-3">
            	<table class="task-tables">
            		<thead>
						<tr>
							<td>Id</td><td>标题</td>
							<td>状态</td><td>考试时间</td>
							<td>类型</td>
						</tr>
					</thead>
					<tbody id="taskListTables"></tbody>
				</table>
				<div class="paging-area-box mt-10 magin-auto">
					<div class="paging-area float-left" id="pagination"></div>
					<span class="pageNum float-right f-14">共<em>0</em>条数据</span>
				</div>
            </div>
        </div>
    </div>
    <footer id="footer" class="full-x f-14 c-666 text-center"></footer>
</body>
<script src="../../static/js/util/jquery-1.9.1.min.js"></script>
<script src="../../static/js/util/bootstrap.min.js"></script>
<script src="../../static/js/util/jquery.paging.min.js"></script>
<script src="../../static/js/commonJS/interface.js"></script>
<script src="../../static/js/commonJS/common.js"></script>

<script>
	function tableListFun(pageNo){
        var id = window.document.getElementById("taskListTables");

        $.ajax({
            url: get_homeworkLlist_interface+'?currentPage='+pageNo,
            type:'post',
            dataType:'json',
			xhrFields:{
				withCredentials:true
			},
			crossDomain:true,
            data:{
                currentPage:pageNo
            },
            success: function(data) {
                if(data.code==200){
                    innerTbody(data,id, tableListFun);
                    console.log(data.data)
                }else{
                    $.message(data.msg);
                }
            },
            error: function (error) {
                $.message("链接超时，请刷新...");
            }
        });
    }

    tableListFun(1);

    function innerTbody(data,id, func){
        var page = data.data.num;
        var currentPage = data.data.currentPage;
        var tml = "";
        $(".pageNum em").html(page);
        if(page>0){
            setPagination(page,currentPage, func);
            var lists = data.data.list;
            $('#pagination').show();
            for (var x=0; x< lists.length;x++) {
                tml += "<tr>"+
                    "<td>"+x+"</td>"+
                    '<td><a href="taskList.html?homework_id='+lists[x]["homework_id"]+'" class="c-009 f-14">'+lists[x]["homework_title"]+'</a></td>'+
                    "<td>"+lists[x]["state"]+"</td>"+
                    "<td>"+lists[x]["start_time"]+"</td>"+
                    "<td>"+lists[x]["type"]+"</td>"+
                    "</tr>" ;
            }
        }else{
            $('#pagination').hide();
        }
        id.innerHTML = tml;
    }

</script>
</html>